package no.sogl.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class Attendance {
	@NotNull
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(style = "SS")
	@Column(updatable = false, insertable = true)
	private Date createdAt = new Date();

	@NotNull
	@Temporal(TemporalType.DATE)
	@DateTimeFormat(style = "S-")
	private Date attendedOn = new Date();

	
	@NotNull
    @ManyToOne
    private Person person;

	@NotNull
    @ManyToOne
    private Team team;

}
